package com.jason.sms.client;

import java.util.ArrayList;
import java.util.List;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPBinding;

import com.jason.sms.agent.SmsService;
import com.jason.sms.agent.util.SmsEntryConstance;

public final class Client {

	private static final QName SERVICE_NAME= new QName(SmsEntryConstance.TargetName, "SmsService");

	private static final QName PORT_NAME= new QName(SmsEntryConstance.TargetName, "SmsServicePort");

	private Client() {

	}

	public static void main(String args[]) throws Exception {

		Service service = Service.create(SERVICE_NAME);
		String endpointAddress = "http://localhost:8080/SmsService";
		service.addPort(PORT_NAME, SOAPBinding.SOAP11HTTP_BINDING,endpointAddress);
		SmsService hw = service.getPort(SmsService.class);
		
		List<String> numbers = new ArrayList<String>();
		numbers.add("13660587367");
		for(int i=0;i<10;i++){
			hw.sendSms("jason","111","test","testsms",numbers);
		}
		

	}

}
